TARGET = ../bin/BARNES
OBJS = code.o code_io.o load.o grav.o getparam.o util.o

CC := gcc
CFLAGS := -O3 -pthread -D_POSIX_C_SOURCE=200112
#CFLAGS := -g3 -pthread -D_POSIX_C_SOURCE=200112
CFLAGS := $(CFLAGS) -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wdisabled-optimization
CFLAGS := $(CFLAGS) -Wpadded -Winline -Wpointer-arith -Wsign-compare -Wendif-labels
LDFLAGS := -lm

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(OBJS) $(CFLAGS) -o $(TARGET) $(LDFLAGS)

clean:
	rm -rf *.o $(TARGET)
	
.SUFFIXES:
.SUFFIXES:	.o .c .h

.c.o:
	$(CC) -c $(CFLAGS) $*.c


 
code.o: code.c stdinc.h
code_io.o: code_io.c stdinc.h
getparam.o: getparam.c stdinc.h
grav.o: grav.c stdinc.h
load.o: load.c stdinc.h
util.o: util.c stdinc.h

